package Test;

import static org.junit.Assert.*;

import java.sql.Date;
import java.util.ArrayList;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import proyecto.*;

public class C8 {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Test
	public void test() {
		Controlador c = new Controlador();
		Usuario user = new Usuario();
		ArrayList<Tarea> tareas = new ArrayList<>();
		Tarea tarea1 = c.crearTarea();
		c.modificarTarea(tarea1,"Tarea1",new Date(2014,10,1),new Date(2014,10,2));
		Tarea tarea2 = c.crearTarea();
		c.modificarTarea(tarea2,"Tarea1",new Date(2014,10,3),new Date(2014,10,4));
		tareas.add(tarea1);
		tareas.add(tarea2);
		user.setTareas(tareas);
		Estadistica e = new Estadistica();
		long resultado = e.duracionMediaTareas(user);
		
		assertEquals("FechaFin incorrecta",resultado,(1*24*60*60)*1000);
	}

}
